home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / standard / trig.z / trig
Encoding:
Text File  |  1998-10-30  |  11.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTRRRRIIIIGGGG((((3333MMMM))))                                                              TTTTRRRRIIIIGGGG((((3333MMMM))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      sin, cos, tan, asin, acos, atan, atan2, fsin, sinf, fcos, cosf, ftan,
  10.      tanf, fasin, asinf, facos, acosf, fatan, atanf, fatan2, atan2f, sinl,
  11.      cosl, tanl, asinl, acosl, atanl, atan2l - trigonometric functions and
  12.      their inverses
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<mmmmaaaatttthhhh....hhhh>>>>
  16.  
  17.      ddddoooouuuubbbblllleeee ssssiiiinnnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
  18.      ffffllllooooaaaatttt ffffssssiiiinnnn((((ffffllllooooaaaatttt xxxx))));;;;
  19.      ffffllllooooaaaatttt ssssiiiinnnnffff((((ffffllllooooaaaatttt xxxx))));;;;
  20.      lllloooonnnngggg ddddoooouuuubbbblllleeee ssssiiiinnnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  21.  
  22.      ddddoooouuuubbbblllleeee ccccoooossss((((ddddoooouuuubbbblllleeee xxxx))));;;;
  23.      ffffllllooooaaaatttt ffffccccoooossss((((ffffllllooooaaaatttt xxxx))));;;;
  24.      ffffllllooooaaaatttt ccccoooossssffff((((ffffllllooooaaaatttt xxxx))));;;;
  25.      lllloooonnnngggg ddddoooouuuubbbblllleeee ccccoooossssllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  26.  
  27.      ddddoooouuuubbbblllleeee ttttaaaannnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
  28.      ffffllllooooaaaatttt ffffttttaaaannnn((((ffffllllooooaaaatttt xxxx))));;;;
  29.      ffffllllooooaaaatttt ttttaaaannnnffff((((ffffllllooooaaaatttt xxxx))));;;;
  30.      lllloooonnnngggg ddddoooouuuubbbblllleeee ttttaaaannnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  31.  
  32.      ddddoooouuuubbbblllleeee aaaassssiiiinnnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
  33.      ffffllllooooaaaatttt ffffaaaassssiiiinnnn((((ffffllllooooaaaatttt xxxx))));;;;
  34.      ffffllllooooaaaatttt aaaassssiiiinnnnffff((((ffffllllooooaaaatttt xxxx))));;;;
  35.      lllloooonnnngggg ddddoooouuuubbbblllleeee aaaassssiiiinnnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  36.  
  37.      ddddoooouuuubbbblllleeee aaaaccccoooossss((((ddddoooouuuubbbblllleeee xxxx))));;;;
  38.      ffffllllooooaaaatttt ffffaaaaccccoooossss((((ffffllllooooaaaatttt xxxx))));;;;
  39.      ffffllllooooaaaatttt aaaaccccoooossssffff((((ffffllllooooaaaatttt xxxx))));;;;
  40.      lllloooonnnngggg ddddoooouuuubbbblllleeee aaaaccccoooossssllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  41.  
  42.      ddddoooouuuubbbblllleeee aaaattttaaaannnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
  43.      ffffllllooooaaaatttt ffffaaaattttaaaannnn((((ffffllllooooaaaatttt xxxx))));;;;
  44.      ffffllllooooaaaatttt aaaattttaaaannnnffff((((ffffllllooooaaaatttt xxxx))));;;;
  45.      lllloooonnnngggg ddddoooouuuubbbblllleeee aaaattttaaaannnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  46.  
  47.      ddddoooouuuubbbblllleeee aaaattttaaaannnn2222((((ddddoooouuuubbbblllleeee yyyy,,,, ddddoooouuuubbbblllleeee xxxx))));;;;
  48.      ffffllllooooaaaatttt ffffaaaattttaaaannnn2222((((ffffllllooooaaaatttt yyyy,,,, ffffllllooooaaaatttt xxxx))));;;;
  49.      ffffllllooooaaaatttt aaaattttaaaannnn2222ffff((((ffffllllooooaaaatttt yyyy,,,, ffffllllooooaaaatttt xxxx))));;;;
  50.      lllloooonnnngggg ddddoooouuuubbbblllleeee aaaattttaaaannnn2222llll((((lllloooonnnngggg ddddoooouuuubbbblllleeee yyyy,,,, \\\\
  51.           lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
  52.  
  53. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  54.      The single-precision and long double-precision routines listed above are
  55.      only available in the standard math library, -_l_m, and in -_l_m_x.
  56.  
  57.      _s_i_n, _c_o_s and _t_a_n return trigonometric functions of radian arguments x for
  58.      double data types.  _f_s_i_n, _f_c_o_s and _f_t_a_n, and their ANSI-named
  59.      counterparts _s_i_n_f, _c_o_s_f and _t_a_n_f return trigonometric functions of radian
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTRRRRIIIIGGGG((((3333MMMM))))                                                              TTTTRRRRIIIIGGGG((((3333MMMM))))
  71.  
  72.  
  73.  
  74.      arguments x for float data types.  _s_i_n_l, _c_o_s_l and _t_a_n_l do the same for
  75.      long double data types.
  76.  
  77.      The _a_s_i_n routines return the arc sine in the range -pi/2 to pi/2.  The
  78.      type of both the return value and the single argument are double for
  79.      _a_s_i_n, float for _f_a_s_i_n and its ANSI-named counterpart _a_s_i_n_f, and long
  80.      double for _a_s_i_n_l.
  81.  
  82.      The _a_c_o_s routines return the arc cosine in the range 0 to pi.  The type
  83.      of both the return value and the single argument are double for _a_c_o_s,
  84.      float for _f_a_c_o_s and its ANSI-named counterpart _a_c_o_s_f, and long double for
  85.      _a_c_o_s_l.
  86.  
  87.      The _a_t_a_n routines return the arc tangent in the range -pi/2 to pi/2.  The
  88.      type of both the return value and the single argument are double for
  89.      _a_t_a_n, float for _f_a_t_a_n and its ANSI-named counterpart _a_t_a_n_f, and long
  90.      double for _a_t_a_n_l.
  91.  
  92.      The _a_t_a_n_2 routines return the arctangent of _y/_x in the range -pi to pi
  93.      using the signs of both arguments to determine the quadrant of the return
  94.      value.  Both the return value and the argument types are double for
  95.      _a_t_a_n_2, float for _f_a_t_a_n_2 and its ANSI-named counterpart _a_t_a_n_2_f, and long
  96.      double for _a_t_a_n_2_l.
  97.  
  98. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  99.      In the diagnostics below, functions in the standard math library _l_i_b_m._a,
  100.      are referred to as -_l_m versions, and those in the the BSD math library
  101.      _l_i_b_m_4_3._a, are referred to as -_l_m_4_3 versions.  The -_l_m versions always
  102.      return the default Quiet NaN and set _e_r_r_n_o to EDOM when a NaN is used as
  103.      an argument.  A NaN argument usually causes the -_l_m_4_3 versions to return
  104.      the same argument.  The -_l_m_4_3 versions never set _e_r_r_n_o.
  105.  
  106.      If |x| > 1 the -_l_m versions of the _a_s_i_n and _a_c_o_s functions set _e_r_r_n_o to
  107.      EDOM and return NaN.  When the argument is greater than one, the return
  108.      value of the -_l_m_4_3 versions is indeterminate.
  109.  
  110.      The _a_t_a_n_2 functions will return zero if both arguments are zero. The -_l_m
  111.      versions also set _e_r_r_n_o to EDOM.  (Exception:  the -_l_m_4_3 versions return
  112.      the following results:
  113.      atan2(0.0, 0.0) = 0.0
  114.      atan2(-0.0, 0.0) = -0.0
  115.      atan2(0.0, -0.0) = pi
  116.      atan2(-0.0, -0.0) = -pi )
  117.  
  118.      See matherr(3M) for a description of error handling for -_l_m_x functions.
  119.  
  120. NNNNOOOOTTTTEEEESSSS
  121.      Single precision routines fsin, fcos, and ftan are accurate to within 1
  122.      ulp for arguments in the range -2**22 to 2**22.  Double precision
  123.      routines sin, cos, and tan are accurate to within 2 ulps for arguments in
  124.      the range -2**28 to 2**28.  Arguments larger than this lose precision
  125.      rapidly, but retain more than 20 bits precision out to +/-2**50 for the
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTRRRRIIIIGGGG((((3333MMMM))))                                                              TTTTRRRRIIIIGGGG((((3333MMMM))))
  137.  
  138.  
  139.  
  140.      double routines.
  141.  
  142.      Long double operations on this system are only supported in round to
  143.      nearest rounding mode (the default).  The system must be in round to
  144.      nearest rounding mode when calling any of the long double functions, or
  145.      incorrect answers will result.
  146.  
  147.      Users concerned with portability to other computer systems should note
  148.      that the long double and float versions of these functions are optional
  149.      according to the ANSI C Programming Language Specification ISO/IEC 9899 :
  150.      1990 (E).
  151.  
  152.      Long double functions have been renamed to be compliant with the ANSI-C
  153.      standard, however to be backward compatible, they may still be called
  154.      with the double precision function name prefixed with a q.
  155.  
  156.      The reasons for assigning a value to _a_t_a_n_2(_0,_0) are these:
  157.  
  158.      (1) Programs that test arguments to avoid computing _a_t_a_n_2(_0,_0) must be
  159.          indifferent to its value.  Programs that require it to be invalid are
  160.          vulnerable to diverse reactions to that invalidity on diverse
  161.          computer systems.
  162.  
  163.      (2) _a_t_a_n_2 is used mostly to convert from rectangular (x,y) to polar
  164.          (r,theta) coordinates that must satisfy x = r*cos theta and y = r*sin
  165.          theta.  These equations are satisfied when (x=0,y=0) is mapped to
  166.          (r=0,theta=0) In general, conversions to polar coordinates should be
  167.          computed thus:
  168.                   r:= hypot(x,y);      ... := sqrt(x*x+y*y)
  169.               theta:= atan2(y,x).
  170.  
  171.      (3) The foregoing formulas need not be altered to cope in a reasonable
  172.          way with signed zeros and infinities on machines, such as SGI 4D
  173.          machines, that conform to IEEE 754; the versions of hypot and atan2
  174.          provided for such a machine are designed to handle all cases.  That
  175.          is why _a_t_a_n_2(+_0,-0) = +_pi, for instance.  In general the formulas
  176.          above are equivalent to these:
  177.          r := sqrt(x*x+y*y); if r = 0 then x := copysign(1,x);
  178.          if x > 0  then theta := 2*atan(y/(r+x))
  179.                    else theta := 2*atan((r-x)/y);
  180.      except if r is infinite then _a_t_a_n_2 will yield an appropriate multiple of
  181.      pi/4 that would otherwise have to be obtained by taking limits.
  182.  
  183. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  184.      math(3M), hypot(3M), sqrt(3M), matherr(3M)
  185.  
  186. AAAAUUUUTTTTHHHHOOOORRRR
  187.      Robert P. Corbett, W. Kahan, Stuart I. McDonald, Peter Tang and, for the
  188.      codes for IEEE 754, Dr. Kwok-Choi Ng.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.